select * from home_live where id={{items.id}} and active=1 and (enddate='0000-00-00' or enddate>'2024-04-28') and (startdate='0000-00-00' or startdate<='2024-04-28') order by startdate desc limit 1
You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '{items.id}} and active=1 and (enddate='0000-00-00' or enddate>'2024-04-28') and ' at line 1